Home

Vintage PC  -  Verifying that the MBR is wiped/zeroed


You are at this web page either because you know what you are doing, or you have been directed here by someone who knows what they are doing.

MBR = Master Boot Record

The MBR is the very first sector on a hard drive used in vintage PC's.  See here.

After a wipe/zero of the MBR (or perhaps the whole drive), someone may want to verify that the MBR is in fact wiped/zeroed.

The following are four of a few options to do that verification.  Three are done on the vintage computer.  One is done within Windows 10/11 on a modern computer.

The following assumes that the wiping procedure/software that was used to wipe the MBR, left the MBR full of zeroes (00).



Option #1

On the vintage computer, you will use some of the functionality of the DOS program named TESTMBR.

Once TESTMBR has started:
1. If you have multiple hard drives: If you need to target the second drive (BIOS drive 81h) instead of the first, use the 'Change target hard drive' option.
2. Use the option of 'View first sector on target hard drive'.

As a result, you will be shown the 512 bytes within the first sector.  Verify that all 512 bytes are 00.

Get TESTMBR from here.



Option #2

Here, on the vintage computer, we will use DEBUG.COM to display the MBR's contents on-screen.

The target of the following code is the first hard drive, hard drive 0 (BIOS drive 80h).  To target the second hard drive instead, use "mov dl,81" instead of "mov dl,80".

Ideally, you are executing this procedure with only one hard drive in the computer, and booting from a DOS boot floppy.  In that way, there is no confusion about which of two hard drives is the first one and which is the second.

Below, I show the segment as 'xxxx'.  That is because the segment that DEBUG.COM uses varies.  If I was to show the segment that I saw, some people would worry because the segment displayed to them was different.

For educational purposes, the code in step 3 is not optimised.  E.g. Setting both DH and DL registers can be done at the same time.


1.   Boot from a DOS boot disk that contains DEBUG.COM
   
2.   Execute DEBUG.  DEBUG will present a dash ("-") prompt.
   
3.   When you see the dash prompt, enter the following commands (shown in brown):

- a 80  
xxxx:0080 mov ah,02  (Comment: [02] = function 02h of INT 13h )
xxxx:0082 mov dl,80  (Comment: [80] = hard drive 0 )
xxxx:0084 mov dh,00  (Comment: [00] = head 0 )
xxxx:0086 mov cx,0001  (Comment: Start at {cylinder 0, sector 1}.  Cylinder number contained in CH and upper two bits of CL.  Sector number in lower 6 bits of CL. )
xxxx:0089 mov al,01  (Comment: [01] = 1 sector is to be read )
xxxx:008B mov bx,0100  (Comment: Point ES:BX to our local data buffer, at offset 0100h )
xxxx:008E int 13  (Comment: INT 13h)
xxxx:0090 int 3  (Comment: Breakpoint return for DEBUG)
xxxx:0091      <------------------------ at this line just press the [ENTER] key - this will return DEBUG's dash prompt
- g=80  (Comment: Executes the code that we typed in above)
   
4.   Shortly after you type in the G=80, the code will finish executing, then DEBUG will list the registers and flags of the CPU.  As shown at here, verify that the AH register contains 00 (AL is unimportant) and that you see "NC".  Those two present is the BIOS indicating that the 'read sector' operation was successful.


A copy of the MBR is now in RAM.  We will now get DEBUG to show it, all 512 bytes of it, to you.


5.   To display the first 256 bytes, enter the following command (shown in brown) at DEBUG's dash prompt:

- d 0100 01FF

The first 256 bytes are displayed to you.  Verify that all 256 bytes are zero (00), as shown at here
   
6.   Then, to display the next (last) 256 bytes, enter the following command (shown in brown) at DEBUG's dash prompt:

- d 0200 02FF

The next 256 bytes are displayed to you.  Verify that all 256 bytes are zero (00), as shown at here.
   
7.   Quit from DEBUG by entering a Q at DEBUG's dash prompt.



Option #3

Here, on the vintage computer, we will use the 'Disk Editor' tool of 'Norton Utilities 6' to display the MBR's contents on-screen.

Note that Disk Editor refers to the first hard drive as 'Hard Disk 1', and the second as 'Hard Disk 2'.

Ideally, you are executing this procedure with only one hard drive in the computer, and booting from a DOS boot floppy.  In that way, there is no confusion about which of two hard drives is the first one and which is the second.


1.   Boot from a DOS boot disk that contains the 'Disk Editor' tool of Norton Utilities 6.  The tool will be named either DISKEDIT.EXE or DE.EXE
   
2.   Execute Disk Editor.
   
3.   If a window appears indicating that Disk Editor is in read-only mode, press the [ENTER] key to acknowlege the message.  (Read-only is okay - we will not be doing any writing.)
   
  We are going to inform Disk Editor that we want to view drives as 'physical'.  'Physical', because viewing a hard drive via 'logical' will view only the DOS partition on the hard drive.
   
4.   On the menu bar, select [Object] then [Drive].  A window will appear.  ALT-D on the keyboard is another way of showing the window.
   
5.   Change the 'Type' to 'Physical disks' by pressing [TAB] then [SPACEBAR].
   
6.   In the left half of the window, you will see a list of physical drives.  If your computer contains two hard drives, the list will include 'Hard Disk 2'.  If the current selection is not your target, then press the [TAB] key three times, then use the UP and DOWN arrow keys to select the desired target.
   
7.   Press the [ENTER] key.  That will close the window, and by default, you will be shown the MBR (cylinder 0, head 0, sector 1) on the chosen hard drive.
   
8.   Verify that all 512 bytes are 00.



Option #4

Here, within Windows 10/11 on a modern computer, we will use HxD software ("Freeware Hex Editor and Disk Editor") to display the MBR's contents on-screen.

1.   Install HxD software on your modern computer (obviously, if not already installed).
   
2.   Attach the CF to your computer via a suitable card reader.
   
3.   On the Windows desktop, right-click on the HxD icon, then of the presented options, click on 'Run as administrator'.
   
4.   When the User Account Control window appears, click on [Yes].
   
5.   On the menu bar, click on [Tools] then [Open disk].   ( On early versions of HxD, [Extras] then [Open disk] )
   
6.   Double-click on the drive that corresponds to the CF.   Guidance on this is shown at here.
   
  Sector 0 and part of sector 1 is displayed, and the insertion point is at the first byte.
The MBR is sector 0 (512 bytes at offset 0 through 1FF).
   
7.   Verify that all bytes in the displayed 'sector 0' are zero (00), as shown at here.
   
8.   Exit HxD.